package top.lyc829.mymusic.ext

import com.lzx.starrysky.SongInfo
import top.lyc829.mymusic.model.bean.Song

/**
 * @Author lyc
 * @create 2021-07-18 13:45
 */

fun Song.convertToSongInfo(): SongInfo {
    val songInfo = SongInfo()
    songInfo.songId = this.id.toString()
    songInfo.artist = this.ar.joinToString(separator = "/") { it.name }
    songInfo.songName = this.name
    val url = this.url
    songInfo.songUrl = url ?: ""
    songInfo.songCover = this.al.picUrl
    songInfo.duration = this.dt
    return songInfo
}